﻿using Newtonsoft.Json;
using System.Diagnostics.Contracts;

namespace Student.ViewModel
{
    public class UserViewModel
    {
        [JsonProperty("userDataId")]
        public int UserDataID
        {
            get;set;
        }

        [JsonProperty("userNo")]
        public string UserNo
        {
            get; set;
        } = "";

        [JsonProperty("workNo")]
        public string WorkNo
        {
            get; set;
        } = "";

        [JsonProperty("fullName")]
        public string FullName
        {
            get; set;
        } = "";

        [JsonProperty("userName")]
        public string UserName
        {
            get; set;
        } = "";

        [JsonProperty("headImage")]
        public string HeadImage
        {
            get; set;
        } = "";

        [JsonProperty("birthday")]
        public DateTime Birthday
        {
            get;set;
        }

        [JsonProperty("mobile")]
        public string Mobile
        {
            get; set;
        } = "";

        [JsonProperty("title")]
        public string Title
        {
            get; set;
        } = "";

        [JsonProperty("userRoleName")]
        public string UserRoleName
        {
            get; set;
        } = "";

        [JsonProperty("departmentId")]
        public int DepartmentID
        {
            get; set;
        }

        [JsonProperty("departmentName")]
        public string DepartmentName
        {
            get; set;
        } = "";

        [JsonProperty("workshopGroupName")]
        public string WorkshopGroupName
        {
            get; set;
        } = "";

        [JsonProperty("sex")]
        public int Sex
        {
            get; set;
        }

        [JsonProperty("planNo")]
        public string PlanNo
        {
            get; set;
        } = "";

        [JsonProperty("processName")]
        public string ProcessName
        {
            get; set;
        } = "";


        [JsonProperty("lastLoginTime")]
        public DateTime LastLoginTime
        {
            get; set;
        }

        [JsonProperty("isDelete")]
        public bool IsDelete
        {
            get; set;
        }
    }

    public class UserDataViewModel
    {
        [JsonProperty("userId")]
        public int UserDataID
        {
            get; set;
        }

        [JsonProperty("userNo")]
        public string UserNo
        {
            get; set;
        } = "";

        [JsonProperty("workNo")]
        public string WorkNo
        {
            get; set;
        } = "";

        [JsonProperty("userName")]
        public string UserName
        {
            get; set;
        } = "";

        [JsonProperty("fullName")]
        public string FullName
        {
            get; set;
        } = "";

        [JsonProperty("headImage")]
        public string HeadImage
        {
            get; set;
        } = "";

        [JsonProperty("departmentId")]
        public int DepartmentID
        {
            get;set;
        }

        [JsonProperty("departmentName")]
        public string DepartmentName
        {
            get; set;
        } = "";

        [JsonProperty("workshopId")]
        public int WorkshopID
        {
            get;set;
        }

        [JsonProperty("workshopName")]
        public string WorkshopName
        {
            get; set;
        } = "";

        [JsonProperty("roles")]
        public List<string> Roles
        {
            get; set;
        } = new List<string>();

        [JsonProperty("permissions")]
        public List<string> Permissions
        {
            get; set;
        } = new List<string>();
    }

    public class UserTokenViewModel
    {
        [JsonProperty("userDataId")]
        public int UserDataID
        {
            get; set;
        }

        [JsonProperty("fullName")]
        public string FullName
        {
            get; set;
        } = "";

        [JsonProperty("roleLevel")]
        public int RoleLevel
        {
            get; set;
        } 
    }
}
